package fantasyday.wowzolo.web.account;

import fantasyday.wowzolo.domain.Account;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.Model;

public class AccountForm extends Form {

	public AccountForm(String id, Account account) {
		super(id, new CompoundPropertyModel(account));
		
		PasswordTextField passField = new PasswordTextField("password");
		add(passField);
		
		PasswordTextField passRepeatedField = new PasswordTextField("passRepeated", new Model(""));
		add(passRepeatedField);
		
		add(new AccountFieldsPanel("accountFields"));

        add(new EqualPasswordInputValidator(passField, passRepeatedField));
	}
}
